<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>用户信息管理</title>
    <#include "../../common/link.ftl">
    <script>
        $(function () {
            $(".btn_delete").click(function () {
                var id = $(this).data('id');
                $.post('/admin/delete.do',{id:id},function (data) {
                    if(data.code == 200){ //用alert或者popup都可以
                        window.location.reload();
                    }else{
                        $.messager.alert("温馨提示", data.msg);
                    }
                })
                })
            })
    </script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <#include "../../common/navbar.ftl">
    <!--菜单回显-->
    <#assign currentMenu="admin"/>
    <#include "../../common/menu.ftl">
    <div class="content-wrapper">
        <section class="content-header">
            <h1>超管信息管理</h1>
        </section>
        <section class="content">
            <div class="box">
                <!--高级查询--->
                <div style="margin: 10px;">
                    <form class="form-inline" id="searchForm" action="/admin/list.do" method="post">
                        <input type="hidden" name="currentPage" id="currentPage" value="1">
                        <div class="form-group">
                            <label for="keyword">关键字:</label>
                            <input type="text" class="form-control" id="keyword" name="keyword" value="${qo.keyword!}" placeholder="请输入用户名/邮箱">
                        </div>
                        <div class="form-group">
                            <label for="keyword">指导老师:</label>
                            <input type="text" class="form-control" id="teach" name="teach" value="${qo.teach!}" placeholder="请输入指导老师的名字">
                        </div>
                        <button id="btn_query" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span> 查询</button>
                        <a href="/admin/input.do" class="btn btn-success btn_redirect">
                            <span class="glyphicon glyphicon-plus"></span> 添加
                        </a>

                    </form>
                </div>
                <table class="table table-hover table-bordered">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>图片</th>
                        <th>编号</th>
                        <th>昵称</th>
                        <th>用户名</th>
                        <th>性别</th>
                        <th>年龄</th>
                        <th>联系方式</th>
                        <th>email</th>
                        <th>负责老师</th>
                        <th>负责老师电话</th>
                        <th>备注</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <#list page.list as admin>
                        <tr>
                            <td>${admin_index+1}</td>
                            <td><img src="${(admin.imgUrl)!'/images/default.jpg'}" width="50px" id="imgUrl"></td>
                            <td>${admin.number!}</td>
                            <td>${(admin.nickname)!}</td>
                            <td>${(admin.username)!}</td>
                            <td>${(admin.sex)!}</td>
                            <td>${(admin.age)!}</td>
                            <td>${(admin.mobile)!}</td>
                            <td>${admin.email!}</td>
                            <td>${(admin.teacher)!}</td>
                            <td>${(admin.teacherMobile)!}</td>
                            <td>${admin.remarks!}</td>
                            <td>
                                <a href="/admin/input.do?id=${admin.id}" class="btn btn-info btn-xs btn_redirect">
                                    <span class="glyphicon glyphicon-pencil"></span> 编辑
                                </a>
                                <a href="#" class="btn btn-danger btn-xs btn_delete"  data-id='${admin.id}'>
                                    <span class="glyphicon glyphicon-trash"></span> 删除
                                </a>
                            </td>
                        </tr>
                    </#list>
                </table>
                <!--分页-->
                <#include "../../common/page.ftl">
            </div>
        </section>
    </div>
    <#include "../../common/footer.ftl">
</div>

<!-- 大图显示 -->
<div id="ShowImage_Form" class="modal fade" >
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body" >
            </div>
        </div>
    </div>
</div>

<script>
    $("table img").click(function(){
        var src = $(this).attr("src");
        $("#ShowImage_Form .modal-body").html("<img src='"+src+"' class='carousel-inner img-responsive img-rounded' />");
        $("#ShowImage_Form").modal('show');
    })
</script>

<style>
    #inputModal img{
        width: 570px !important;
    }
</style>

</body>
</html>
